package com.tencent.iov.cowin.befsale.clue.dao.http.mdwrite;

import com.tencent.iov.cowin.befsale.clue.dao.http.mdwrite.request.AddCertificateInfoRequest;
import com.tencent.iov.cowin.befsale.clue.dao.http.mdwrite.request.AddSecondaryDealerRequest;
import com.tencent.iov.cowin.befsale.clue.dao.http.mdwrite.request.UpdateCertificateInfoRequest;
import com.tencent.iov.cowin.befsale.clue.value.contants.ServiceConstant;
import com.software.boot.common.entity.Response;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;

/**
 * @Author xiamu
 * @Date 2022/1/27 14:52
 * @Version 1.0
 **/
@FeignClient(name = ServiceConstant.SCRM_MD_WRITE_SERVICE,
        url = ServiceConstant.SCRM_MD_WRITE_SERVICE_HOST)
//        url = "http://scrm-dev.scrm-md-write-service.innet.dm.newcowin.com/")
public interface MdWriteClient {
    String DEALER_SECONDARY_URL = "/v1/org/secondary-dealer";
    String CUS_CERTIFICATEINFO_URL = "/v1/cus/certificateInfo";
    /**
     * 保存二网信息
     * @param request 保存参数
     * @return 保存是否成功
     */
    @ApiOperation(value = "二网管理-新增二网经销商", httpMethod = "POST", response = Response.class, notes = "insert")
    @PostMapping(DEALER_SECONDARY_URL + "/insert")
    Response<Long> insert(@ApiParam(required = true, value = "二网信息") @RequestBody AddSecondaryDealerRequest request);

    @ApiOperation(value = "CertificateInfo管理-添加信息接口", httpMethod = "POST", response = Response.class, notes = "add")
    @RequestMapping(path = CUS_CERTIFICATEINFO_URL + "/add", method = RequestMethod.POST)
    Response<Integer> add(@Valid @RequestBody AddCertificateInfoRequest request) ;

    @ApiOperation(value = "CertificateInfo管理-修改信息接口", httpMethod = "POST", response = Response.class, notes = "update")
    @RequestMapping(path = CUS_CERTIFICATEINFO_URL + "/update", method = RequestMethod.POST)
    Response<Integer> update(@Valid @RequestBody UpdateCertificateInfoRequest request);
}
